<?php
class Logger
{
	private static $instance = null;

	public static $log_file = 'logs/base';
	
	public static function getInstance()
	{
		if ( self::$instance == null )
		{
			self::$instance = new Logger();
		}
		
		return self::$instance;
	}
	
	function Write($src, $msg)
	{ 
		$ymd = date("Y-m-d", mktime());
		$fd = fopen(self::$log_file.".".$ymd.".log", "a+");
		$str  = date("H:i:s", mktime());
		$str .= "\t".$_SERVER['REMOTE_ADDR'];
		$str .= "\t".$src."\t".$msg."\n";
		fwrite($fd, $str);
		fclose($fd);
	}
}
?>